From: Keir Fraser Date: Fri, 11 Apr 2008 14:55:42 +0000 (+0100) Subject: Turn some simple softirqs into tasklets. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14231^2~18 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=e9b5fb4377d1de367b6a14fca1493b4e6944d8c9;p=xen.git Turn some simple softirqs into tasklets. TRACE_SOFTIRQ does not appear to be necessary at all. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index d9e1b57b22..c9f879b351 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2637,12 +2637,14 @@ asmlinkage void do_general_protection(struct cpu_user_regs *regs) panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code); } -static void nmi_softirq(void) +static void nmi_action(unsigned long unused) { /* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */ vcpu_kick(dom0->vcpu[0]); } +static DECLARE_TASKLET(nmi_tasklet, nmi_action, 0); + static void nmi_dom0_report(unsigned int reason_idx) { struct domain *d; @@ -2654,7 +2656,7 @@ static void nmi_dom0_report(unsigned int reason_idx) set_bit(reason_idx, nmi_reason(d)); if ( !test_and_set_bool(v->nmi_pending) ) - raise_softirq(NMI_SOFTIRQ); /* not safe to wake up a vcpu here */ + tasklet_schedule(&nmi_tasklet); /* not safe to wake a vcpu here */ } asmlinkage void mem_parity_error(struct cpu_user_regs *regs) @@ -2932,8 +2934,6 @@ void __init trap_init(void) percpu_traps_init(); cpu_init(); - - open_softirq(NMI_SOFTIRQ, nmi_softirq); } long register_guest_nmi_callback(unsigned long address) diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index b414452562..934edb5dc9 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -32,7 +32,7 @@ static struct { static unsigned char keypress_key; -static void keypress_softirq(void) +static void keypress_action(unsigned long unused) { keyhandler_t *h; unsigned char key = keypress_key; @@ -42,6 +42,8 @@ static void keypress_softirq(void) console_end_log_everything(); } +static DECLARE_TASKLET(keypress_tasklet, keypress_action, 0); + void handle_keypress(unsigned char key, struct cpu_user_regs *regs) { irq_keyhandler_t *h; @@ -56,7 +58,7 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs) else { keypress_key = key; - raise_softirq(KEYPRESS_SOFTIRQ); + tasklet_schedule(&keypress_tasklet); } } @@ -284,8 +286,6 @@ static void do_debug_key(unsigned char key, struct cpu_user_regs *regs) void __init initialize_keytable(void) { - open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq); - register_irq_keyhandler( 'd', dump_registers, "dump registers"); register_keyhandler( diff --git a/xen/common/trace.c b/xen/common/trace.c index 863816b9ee..12ff7a029c 100644 --- a/xen/common/trace.c +++ b/xen/common/trace.c @@ -69,12 +69,6 @@ static cpumask_t tb_cpu_mask = CPU_MASK_ALL; /* which tracing events are enabled */ static u32 tb_event_mask = TRC_ALL; -static void trace_notify_guest(void) -{ - send_guest_global_virq(dom0, VIRQ_TBUF); -} - - /** * alloc_trace_bufs - performs initialization of the per-cpu trace buffers. * @@ -120,7 +114,6 @@ static int alloc_trace_bufs(void) } t_buf_highwater = data_size >> 1; /* 50% high water */ - open_softirq(TRACE_SOFTIRQ, trace_notify_guest); return 0; } @@ -513,7 +506,7 @@ void __trace_var(u32 event, int cycles, int extra, unsigned char *extra_data) /* Notify trace buffer consumer that we've crossed the high water mark. */ if ( started_below_highwater && (calc_unconsumed_bytes(buf) >= t_buf_highwater) ) - raise_softirq(TRACE_SOFTIRQ); + send_guest_global_virq(dom0, VIRQ_TBUF); } /* diff --git a/xen/include/xen/softirq.h b/xen/include/xen/softirq.h index 440bfa6c6c..dbf4606261 100644 --- a/xen/include/xen/softirq.h +++ b/xen/include/xen/softirq.h @@ -6,10 +6,7 @@ enum { TIMER_SOFTIRQ = 0, SCHEDULE_SOFTIRQ, NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ, - KEYPRESS_SOFTIRQ, - NMI_SOFTIRQ, PAGE_SCRUB_SOFTIRQ, - TRACE_SOFTIRQ, RCU_SOFTIRQ, STOPMACHINE_SOFTIRQ, TASKLET_SOFTIRQ,